****************************************************************************************************************************************************
***Supplementary material for: "Greed, Envy, and Admiration: The Distinct Nature of Public Opinion about Redistribution from the Rich" *************
****************************************************************************************************************************************************
****************************************************************************************************************************************************
****************************************************************************************************************************************************

*set working directory 
*to produce tables, download and install esttab: ssc install estout 
*to produce figures, download and install coefplot: ssc install coefplot

*Table A1

use "prepared data 1", clear
sum effort_rich proso_rich taxrich effort_poor proso_poor welfare
use "prepared data 2", clear
sum effort_rich proso_rich taxrich envy_r admi_r comp_r effort_poor proso_poor welfare envy_p admi_p comp_p
use "prepared data 3", clear
sum taxrich demand richinequality envy admi comp welfare help poorinequality
use "prepared data 4", clear
sum effort_rich proso_rich taxrich envy_r admi_r comp_r effort_poor proso_poor welfare envy_p admi_p comp_p

*Figure A1. 

use "prepared data 1", clear

histogram effort_rich, frequency name(his_effort_rich1) scheme(s1mono) 
histogram proso_rich, frequency name(his_proso_rich1) scheme(s1mono) 
histogram taxrich, frequency name(his_taxrich1) scheme(s1mono) 
histogram effort_poor, frequency  name(his_effort_poor1) scheme(s1mono) 
histogram proso_poor, frequency  name(his_proso_poor1) scheme(s1mono) 
histogram welfare, frequency name(his_welfare1) scheme(s1mono)

graph combine his_effort_rich1 his_proso_rich1 his_taxrich1 his_effort_poor1 his_proso_poor1 his_welfare1
graph export "FigureA1.png", as(png) replace

*Figure A2.1 

use "prepared data 2", clear

histogram effort_rich, frequency name(his_effort_rich2) scheme(s1mono) 
histogram proso_rich, frequency name(his_proso_rich2) scheme(s1mono) 
histogram taxrich, frequency name(his_taxrich2) scheme(s1mono) 
histogram effort_poor, frequency  name(his_effort_poor2) scheme(s1mono) 
histogram proso_poor, frequency  name(his_proso_poor2) scheme(s1mono) 
histogram welfare, frequency name(his_welfare2) scheme(s1mono)

graph combine his_effort_rich2 his_proso_rich2 his_taxrich2 his_effort_poor2 his_proso_poor2 his_welfare2
graph export "FigureA2.1.png", as(png) replace

*Figure A2.2 

histogram envy_r, frequency name(his_envy_r2) scheme(s1mono) 
histogram admi_r, frequency name(his_admi_r2) scheme(s1mono) 
histogram comp_r, frequency name(his_comp_r2) scheme(s1mono) 
histogram envy_p, frequency name(his_envy_p2) scheme(s1mono) 
histogram admi_p, frequency name(his_admi_p2) scheme(s1mono) 
histogram comp_p, frequency name(his_comp_p2) scheme(s1mono) 

graph combine his_envy_r2 his_admi_r2 his_comp_r2 his_envy_p2 his_admi_p2 his_comp_p2 
graph export "FigureA2.2.png", as(png) replace

*Figure A3 

use "prepared data 3", clear

histogram taxrich, frequency name(his_taxrich3) scheme(s1mono) 
histogram demand, frequency name(his_demand3) scheme(s1mono) 
histogram richinequality, frequency name(his_richinequality3) scheme(s1mono) 
histogram envy, frequency name(his_envy3) scheme(s1mono) 
histogram admi, frequency name(his_admi3) scheme(s1mono) 
histogram comp, frequency name(his_comp3) scheme(s1mono) 
histogram welfare, frequency name(his_welfare3) scheme(s1mono) 
histogram help, frequency name(his_help3) scheme(s1mono) 
histogram poorinequality, frequency name(his_poorinequality3) scheme(s1mono) 

graph combine his_taxrich3 his_demand3 his_richinequality3 his_envy3 his_admi3 his_comp3 his_welfare3 his_help3 his_poorinequality3 
graph export "FigureA3.png", as(png) replace

*Figure A4.1

use "prepared data 4", clear

histogram effort_rich, frequency name(his_effort_rich4) scheme(s1mono) 
histogram proso_rich, frequency name(his_proso_rich4) scheme(s1mono) 
histogram taxrich, frequency name(his_taxrich4) scheme(s1mono) 
histogram effort_poor, frequency  name(his_effort_poor4) scheme(s1mono) 
histogram proso_poor, frequency  name(his_proso_poor4) scheme(s1mono) 
histogram welfare, frequency name(his_welfare4) scheme(s1mono)

graph combine his_effort_rich4 his_proso_rich4 his_taxrich4 his_effort_poor4 his_proso_poor4 his_welfare4
graph export "FigureA4.1.png", as(png) replace

*Figure A4.2

histogram envy_r, frequency name(his_envy_r4) scheme(s1mono) 
histogram admi_r, frequency name(his_admi_r4) scheme(s1mono) 
histogram comp_r, frequency name(his_comp_r4) scheme(s1mono) 
histogram envy_p, frequency name(his_envy_p4) scheme(s1mono) 
histogram admi_p, frequency name(his_admi_p4) scheme(s1mono) 
histogram comp_p, frequency name(his_comp_p4) scheme(s1mono) 

graph combine his_envy_r4 his_admi_r4 his_comp_r4 his_envy_p4 his_admi_p4 his_comp_p4 
graph export "FigureA4.2.png", as(png) replace

*Table A2

use "prepared data 1", clear

cor effort_rich effort_poor proso_rich proso_poor 

*Table A3

use "prepared data 2", clear

cor effort_rich effort_poor proso_rich proso_poor envy_r envy_p admi_r admi_p comp_r comp_p

*Table A4

use "prepared data 3", clear

cor envy admi comp

*Table A5

use "prepared data 4", clear

cor effort_rich effort_poor proso_rich proso_poor envy_r envy_p admi_r admi_p comp_r comp_p 

*Table A6

use "prepared data 1", clear

egen z2effort_rich = std(effort_rich), mean(0) std(1)
egen z2proso_rich = std(proso_rich), mean(0) std(1)
sum z2effort_rich z2proso_rich

eststo clear
reg taxrich z2effort_rich z2proso_rich Age Gender Income Education i.party
test z2effort_rich=z2proso_rich 
eststo Rich1

use "prepared data 2", clear

egen z2effort_rich = std(effort_rich), mean(0) std(1)
egen z2proso_rich = std(proso_rich), mean(0) std(1)
sum z2effort_rich z2proso_rich

reg taxrich z2effort_rich z2proso_rich Age Gender Income Education Race i.party
test z2effort_rich=z2proso_rich 
eststo Rich2

use "prepared data 4", clear

egen z2effort_rich = std(effort_rich), mean(0) std(1) 
egen z2proso_rich = std(proso_rich), mean(0) std(1)
sum z2effort_rich z2proso_rich

reg taxrich z2effort_rich z2proso_rich Age Gender Income Education Race i.party
test z2effort_rich=z2proso_rich 
eststo Rich4

esttab Rich1 Rich2 Rich4, b(%05.3f) se(%5.3f), using tabA6.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2

*Table A7

use "prepared data 1", clear

eststo clear
reg upper effort_rich proso_rich Age Gender Income Education i.party
test effort_rich=proso_rich 
eststo Rich1

esttab Rich1, b(%05.3f) se(%5.3f), using tabA7.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2 

*Table A8

use "prepared data 2", clear

eststo clear
reg taxcor effort_rich proso_rich Age Gender Income Education Race i.party
test effort_rich=proso_rich
eststo Rich1

reg taxcor envy_r admi_r comp_r Age Gender Income Education Race i.party
eststo Rich2

reg upper effort_rich proso_rich Age Gender Income Education Race i.party
test effort_rich=proso_rich
eststo Rich3

reg upper envy_r admi_r comp_r Age Gender Income Education Race i.party
eststo Rich4

esttab Rich1 Rich2 Rich3 Rich4, b(%05.3f) se(%5.3f), using tabA8.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2

*Table A9

use "prepared data 4", clear 

eststo clear
reg richshare effort_rich proso_rich Age Gender Income Education Race i.party
test effort_rich=proso_rich 
eststo Richshare

reg richshare envy_r admi_r comp_r Age Gender Income Education Race i.party
eststo Richshareemotions

esttab Richshare Richshareemotions, b(%05.3f) se(%5.3f), using tabA9.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2

*Table A10

use "prepared data 2", clear

eststo clear
reg taxrich vrich_lazy rich_hard vrich_greed rich_gen Age Gender Income Education Race i.party
test (vrich_lazy+rich_hard)=(vrich_greed+rich_gen)
eststo Rich

reg welfare vpoor_lazy poor_hard vpoor_greed poor_gen Age Gender Income Education Race i.party
test (vpoor_lazy+poor_hard)=(vpoor_greed+poor_gen)
eststo Poor

esttab Rich Poor, b(%05.3f) se(%5.3f), using tabA10.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2

*Table A11

use "prepared data 2", clear

reg taxrich ef_rich pro_rich Age Gender Income Education Race i.party
test ef_rich=pro_rich 
eststo Rich1

reg welfare ef_poor pro_poor Age Gender Income Education Race i.party
test ef_poor=pro_poor 
eststo Poor1

reg taxrich ef_rich like_rich Age Gender Income Education Race i.party
test ef_rich=like_rich 
eststo Rich2

reg welfare ef_poor like_poor Age Gender Income Education Race i.party
test ef_poor=like_poor 
eststo Poor2

esttab Rich1 Poor1 Rich2 Poor2, b(%05.3f) se(%5.3f), using tabA11.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2

*Table A12

use "prepared data 3", clear

reg taxrich effort proso Age Gender Income Education i.party
test effort=proso
eststo taxrich

reg demand effort proso Age Gender Income Education i.party
test effort=proso
eststo demand

reg richinequality effort proso Age Gender Income Education i.party
test effort=proso
eststo richinequality

esttab taxrich demand richinequality, b(%05.3f) se(%5.3f), using tabA12.rtf, replace onecell star (+ 0.10 * 0.05 ** 0.01 *** 0.001) wide constant ar2